package libs.yzx.zaza;

import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import libs.yzx.zaza.za.AbsPullLayout;
import libs.yzx.zaza.za.RLayout;

/**
 * Created by Administrator on 2016/7/19.
 */
public class RefreshActivity extends AppCompatActivity {

    private RLayout rl;
    private ListView lv;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ra);

        rl = (RLayout) findViewById(R.id.ra);


        lv = (ListView) findViewById(R.id.lv);
        lv.setBackgroundColor(Color.GRAY);

        rl.setOnRefreshListener(new AbsPullLayout.OnRefreshingListener() {
            public void onRefresh(AbsPullLayout layout) {
                new Handler().postDelayed(new Runnable() {
                    public void run() {
                        rl.setRefreshing(false, true);
                    }
                }, 2400);
            }
        });

    }

}
